#ifndef _UTILS_TIMER_H_
#define _UTILS_TIMER_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>

    typedef enum
    {
        TIMER_TYPE_REALTIME = 0,
        TIMER_TYPE_ALARM,
    } TIMER_TYPE;

    typedef void (*timer_callback_func)(void *);

    /**
     * @brief create timer
     *
     * @param timer_type
     * @param callback
     * @param param
     * @param second
     * @param repeat
     * @return int
     */
    extern int utils_create_timer(TIMER_TYPE timer_type, timer_callback_func callback, void *param, unsigned int second, int repeat);
    extern int utils_delete_timer(int timer_id);
    extern uint64_t utils_time_usec();
    extern uint64_t utils_time_msec();

#ifdef __cplusplus
}
#endif
#endif //_UTILS_TIMER_H_